
//#include "..\SystemInitialData\SystemInformation.h"



/***********************************************
 * not put the data in memory
 * this is for SOC function to use
 ***********************************************/
//#define SOC_BATTERY_OV_VOLTAGE     __2ND_BATTERY_OV_PROTECTION_     //5600
//#define SOC_BATTERY_UV_VOLTAGE     __2ND_BATTERY_UV_PROTECTION_     //3700
//#define SOC_1st_CELL_OV_VOLTAGE     4250 //mV
//#define SOC_1st_CELL_UV_VOLTAGE     2500 //mV


#define OCV_TABLE_POINTS 51
#define NUM_OF_OCV_LINE  6

#define RESIDUAL_CAPACITY_INDEX         0
#define RESIDUAL_DSG_1st_CURRENT_INDEX  1
#define RESIDUAL_DSG_2nd_CURRENT_INDEX  2
#define RESIDUAL_DSG_3rd_CURRENT_INDEX  3
#define RESIDUAL_DSG_4th_CURRENT_INDEX  4
#define RESIDUAL_OCV_CURRENT_INDEX      5
#define RESIDUAL_CHG_1st_CURRENT_INDEX  6


/*
; TERMINAL_VOLTAGE units is mV
; RESIDUAL_CAPACITY units is percentage
; Please sort from largest to smallest
// 2600mAh cell, 25 degree, OCV Table
*/

const unsigned int RealOCVTable[OCV_TABLE_POINTS][NUM_OF_OCV_LINE+1] =
{
////////////// RESIDUAL CAPACITY ////////////////////////////////////////////////////////////////
//10.4Ah      1st       2nd      3rd        4th       OCV        1st 
//Capacity,  DSG 5A,  DSG 7.5A,  DSG 10A,  DSG 15A,    OCV,    CHG 2A,     ///////////////////////
//   (%)      (mV)       (mV)      (mV)      (mV)      (mV)      (mV)
    { 100,    54405,    54405,    54405,    54405,    54405,    54423   },   //index = 00       
    { 98 ,    52065,    50995,    50323,    48749,    54100,    54293   },   //index = 01       
    { 96 ,    51693,    50494,    49779,    48046,    53796,    54161   },   //index = 02       
    { 94 ,    51375,    50151,    49421,    47663,    53523,    54028   },   //index = 03       
    { 92 ,    51075,    49854,    49117,    47332,    53259,    53892   },   //index = 04       
    { 90 ,    50799,    49581,    48842,    47089,    52996,    53759   },   //index = 05       
    { 88 ,    50518,    49325,    48583,    46841,    52750,    53633   },   //index = 06       
    { 86 ,    50247,    49081,    48340,    46642,    52506,    53381   },   //index = 07       
    { 84 ,    49985,    48848,    48106,    46430,    52272,    53139   },   //index = 08       
    { 82 ,    49732,    48624,    47880,    46250,    52059,    52913   },   //index = 09       
    { 80 ,    49490,    48409,    47667,    46055,    51836,    52693   },   //index = 10       
    { 78 ,    49265,    48216,    47476,    45865,    51636,    52484   },   //index = 11       
    { 76 ,    49040,    48015,    47274,    45703,    51443,    52287   },   //index = 12       
    { 74 ,    48825,    47823,    47081,    45524,    51254,    52109   },   //index = 13       
    { 72 ,    48617,    47638,    46893,    45370,    51082,    51938   },   //index = 14       
    { 70 ,    48421,    47460,    46714,    45201,    50909,    51781   },   //index = 15       
    { 68 ,    48231,    47288,    46538,    45055,    50756,    51637   },   //index = 16       
    { 66 ,    48057,    47123,    46368,    44894,    50610,    51506   },   //index = 17       
    { 64 ,    47886,    46964,    46208,    44742,    50460,    51389   },   //index = 18       
    { 62 ,    47718,    46813,    46050,    44610,    50338,    51281   },   //index = 19       
    { 60 ,    47562,    46669,    45903,    44470,    50209,    51182   },   //index = 20       
    { 58 ,    47431,    46532,    45777,    44371,    50018,    51091   },   //index = 21       
    { 56 ,    47328,    46403,    45674,    44276,    49772,    51001   },   //index = 22       
    { 54 ,    47223,    46282,    45573,    44196,    49559,    50897   },   //index = 23       
    { 52 ,    47122,    46177,    45485,    44101,    49375,    50793   },   //index = 24       
    { 50 ,    47017,    46071,    45380,    43995,    49264,    50704   },   //index = 25       
    { 48 ,    46911,    45972,    45276,    43897,    49189,    50628   },   //index = 26       
    { 46 ,    46812,    45879,    45179,    43789,    49112,    50563   },   //index = 27       
    { 44 ,    46705,    45789,    45077,    43685,    49081,    50502   },   //index = 28       
    { 42 ,    46603,    45701,    44977,    43569,    49051,    50445   },   //index = 29       
    { 40 ,    46491,    45614,    44875,    43464,    49026,    50392   },   //index = 30       
    { 38 ,    46374,    45525,    44772,    43342,    49005,    50343   },   //index = 31       
    { 36 ,    46247,    45431,    44662,    43219,    48985,    50296   },   //index = 32       
    { 34 ,    46109,    45334,    44549,    43105,    48961,    50252   },   //index = 33       
    { 32 ,    45955,    45227,    44424,    42970,    48938,    50211   },   //index = 34       
    { 30 ,    45792,    45111,    44291,    42844,    48901,    50172   },   //index = 35       
    { 28 ,    45613,    44981,    44149,    42698,    48824,    50136   },   //index = 36       
    { 26 ,    45402,    44844,    43991,    42540,    48783,    50098   },   //index = 37       
    { 24 ,    45193,    44677,    43824,    42363,    48618,    50051   },   //index = 38       
    { 22 ,    44960,    44483,    43625,    42178,    48453,    49975   },   //index = 39       
    { 20 ,    44707,    44259,    43395,    41937,    48254,    49832   },   //index = 40       
    { 18 ,    44466,    44004,    43163,    41706,    47888,    49561   },   //index = 41       
    { 16 ,    44176,    43740,    42919,    41498,    47534,    49091   },   //index = 42       
    { 14 ,    43950,    43493,    42703,    41261,    47144,    48436   },   //index = 43       
    { 12 ,    43745,    43233,    42469,    41031,    46762,    47851   },   //index = 44       
    { 10 ,    43484,    42944,    42190,    40726,    46428,    47438   },   //index = 45       
    { 8  ,    43154,    42623,    41857,    40388,    46165,    47113   },   //index = 46       
    { 6  ,    42659,    42163,    41358,    39777,    45884,    46833   },   //index = 47       
    { 4  ,    41580,    41201,    40311,    38547,    45314,    46497   },   //index = 48       
    { 2  ,    39177,    39120,    38083,    36414,    43908,    45087   },   //index = 49       
    { 0  ,    32532,    35839,    34735,    32500,    40937,    41039   }    //index = 50  
};                                                            




//#define TERMINAL_VOLTAGE_INDEX 0                            
//#define RESIDUAL_CAPACITY_INDEX 1                           
//                                                            
//const int RealOCVTable[OCV_TABLE_POINTS][2] =               
//{                                                           
//  {  4087,  9994  },    //index=00,  1st                    
//  {  3997,  9496  },    //index=01,  2nd                    
//  {  3941,  8998  },    //index=02,  3rd                    
//  {  3890,  8499  },    //index=03,  4th                    
//  {  3843,  8000  },    //index=04,  5th                    
//  {  3800,  7501  },    //index=05,  6th                    
//  {  3761,  7002  },    //index=06,  7th                    
//  {  3727,  6504  },    //index=07,  8th                    
//  {  3695,  6005  },    //index=08,  9th                    
//  {  3666,  5507  },    //index=09,  10th                   
//  {  3641,  5009  },    //index=10,  11th                   
//  {  3618,  4510  },    //index=11,  12th                   
//  {  3596,  4012  },    //index=12,  13th                   
//  {  3572,  3513  },    //index=13,  14th                   
//  {  3544,  3015  },    //index=14,  15th                   
//  {  3511,  2515  },    //index=15,  16th                   
//  {  3473,  2016  },    //index=16,  17th                   
//  {  3432,  1518  },    //index=17,  18th                   
//  {  3381,  1019  },    //index=18,  19th                   
//  {  3299,  521   },    //index=19,  20th                   
//  {  2748,  0     }     //index=20,  21th                   
//};                                                          
                                                              
                                                              
